"undefined"==typeof leadiaCloud?leadiaCloud={}:leadiaCloud=leadiaCloud||{},function(lc){!function($,jQuery){(function(){var e=this,t=e._,i=Array.prototype,n=Object.prototype,a=Function.prototype,o=i.push,s=i.slice,r=i.concat,l=n.toString,d=n.hasOwnProperty,c=Array.isArray,p=Object.keys,u=a.bind,h=function(e){return e instanceof h?e:this instanceof h?void(this._wrapped=e):new h(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports._=h):e._=h,h.VERSION="1.7.0";var m=function(e,t,i){if(void 0===t)return e;switch(null==i?3:i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,a){return e.call(t,i,n,a)};case 4:return function(i,n,a,o){return e.call(t,i,n,a,o)}}return function(){return e.apply(t,arguments)}};h.iteratee=function(e,t,i){return null==e?h.identity:h.isFunction(e)?m(e,t,i):h.isObject(e)?h.matches(e):h.property(e)},h.each=h.forEach=function(e,t,i){if(null==e)return e;t=m(t,i);var n,a=e.length;if(a===+a)for(n=0;a>n;n++)t(e[n],n,e);else{var o=h.keys(e);for(n=0,a=o.length;a>n;n++)t(e[o[n]],o[n],e)}return e},h.map=h.collect=function(e,t,i){if(null==e)return[];t=h.iteratee(t,i);for(var n,a=e.length!==+e.length&&h.keys(e),o=(a||e).length,s=Array(o),r=0;o>r;r++)n=a?a[r]:r,s[r]=t(e[n],n,e);return s};var f="Reduce of empty array with no initial value";h.reduce=h.foldl=h.inject=function(e,t,i,n){null==e&&(e=[]),t=m(t,n,4);var a,o=e.length!==+e.length&&h.keys(e),s=(o||e).length,r=0;if(arguments.length<3){if(!s)throw new TypeError(f);i=e[o?o[r++]:r++]}for(;s>r;r++)a=o?o[r]:r,i=t(i,e[a],a,e);return i},h.reduceRight=h.foldr=function(e,t,i,n){null==e&&(e=[]),t=m(t,n,4);var a,o=e.length!==+e.length&&h.keys(e),s=(o||e).length;if(arguments.length<3){if(!s)throw new TypeError(f);i=e[o?o[--s]:--s]}for(;s--;)a=o?o[s]:s,i=t(i,e[a],a,e);return i},h.find=h.detect=function(e,t,i){var n;return t=h.iteratee(t,i),h.some(e,function(e,i,a){return t(e,i,a)?(n=e,!0):void 0}),n},h.filter=h.select=function(e,t,i){var n=[];return null==e?n:(t=h.iteratee(t,i),h.each(e,function(e,i,a){t(e,i,a)&&n.push(e)}),n)},h.reject=function(e,t,i){return h.filter(e,h.negate(h.iteratee(t)),i)},h.every=h.all=function(e,t,i){if(null==e)return!0;t=h.iteratee(t,i);var n,a,o=e.length!==+e.length&&h.keys(e),s=(o||e).length;for(n=0;s>n;n++)if(a=o?o[n]:n,!t(e[a],a,e))return!1;return!0},h.some=h.any=function(e,t,i){if(null==e)return!1;t=h.iteratee(t,i);var n,a,o=e.length!==+e.length&&h.keys(e),s=(o||e).length;for(n=0;s>n;n++)if(a=o?o[n]:n,t(e[a],a,e))return!0;return!1},h.contains=h.include=function(e,t){return null!=e&&(e.length!==+e.length&&(e=h.values(e)),h.indexOf(e,t)>=0)},h.invoke=function(e,t){var i=s.call(arguments,2),n=h.isFunction(t);return h.map(e,function(e){return(n?t:e[t]).apply(e,i)})},h.pluck=function(e,t){return h.map(e,h.property(t))},h.where=function(e,t){return h.filter(e,h.matches(t))},h.findWhere=function(e,t){return h.find(e,h.matches(t))},h.max=function(e,t,i){var n,a,o=-1/0,s=-1/0;if(null==t&&null!=e){e=e.length===+e.length?e:h.values(e);for(var r=0,l=e.length;l>r;r++)n=e[r],n>o&&(o=n)}else t=h.iteratee(t,i),h.each(e,function(e,i,n){a=t(e,i,n),(a>s||a===-1/0&&o===-1/0)&&(o=e,s=a)});return o},h.min=function(e,t,i){var n,a,o=1/0,s=1/0;if(null==t&&null!=e){e=e.length===+e.length?e:h.values(e);for(var r=0,l=e.length;l>r;r++)n=e[r],o>n&&(o=n)}else t=h.iteratee(t,i),h.each(e,function(e,i,n){a=t(e,i,n),(s>a||1/0===a&&1/0===o)&&(o=e,s=a)});return o},h.shuffle=function(e){for(var t,i=e&&e.length===+e.length?e:h.values(e),n=i.length,a=Array(n),o=0;n>o;o++)t=h.random(0,o),t!==o&&(a[o]=a[t]),a[t]=i[o];return a},h.sample=function(e,t,i){return null==t||i?(e.length!==+e.length&&(e=h.values(e)),e[h.random(e.length-1)]):h.shuffle(e).slice(0,Math.max(0,t))},h.sortBy=function(e,t,i){return t=h.iteratee(t,i),h.pluck(h.map(e,function(e,i,n){return{value:e,index:i,criteria:t(e,i,n)}}).sort(function(e,t){var i=e.criteria,n=t.criteria;if(i!==n){if(i>n||void 0===i)return 1;if(n>i||void 0===n)return-1}return e.index-t.index}),"value")};var g=function(e){return function(t,i,n){var a={};return i=h.iteratee(i,n),h.each(t,function(n,o){var s=i(n,o,t);e(a,n,s)}),a}};h.groupBy=g(function(e,t,i){h.has(e,i)?e[i].push(t):e[i]=[t]}),h.indexBy=g(function(e,t,i){e[i]=t}),h.countBy=g(function(e,t,i){h.has(e,i)?e[i]++:e[i]=1}),h.sortedIndex=function(e,t,i,n){i=h.iteratee(i,n,1);for(var a=i(t),o=0,s=e.length;s>o;){var r=o+s>>>1;i(e[r])t?[]:s.call(e,0,t)},h.initial=function(e,t,i){return s.call(e,0,Math.max(0,e.length-(null==t||i?1:t)))},h.last=function(e,t,i){return null==e?void 0:null==t||i?e[e.length-1]:s.call(e,Math.max(e.length-t,0))},h.rest=h.tail=h.drop=function(e,t,i){return s.call(e,null==t||i?1:t)},h.compact=function(e){return h.filter(e,h.identity)};var _=function(e,t,i,n){if(t&&h.every(e,h.isArray))return r.apply(n,e);for(var a=0,s=e.length;s>a;a++){var l=e[a];h.isArray(l)||h.isArguments(l)?t?o.apply(n,l):_(l,t,i,n):i||n.push(l)}return n};h.flatten=function(e,t){return _(e,t,!1,[])},h.without=function(e){return h.difference(e,s.call(arguments,1))},h.uniq=h.unique=function(e,t,i,n){if(null==e)return[];h.isBoolean(t)||(n=i,i=t,t=!1),null!=i&&(i=h.iteratee(i,n));for(var a=[],o=[],s=0,r=e.length;r>s;s++){var l=e[s];if(t)s&&o===l||a.push(l),o=l;else if(i){var d=i(l,s,e);h.indexOf(o,d)<0&&(o.push(d),a.push(l))}else h.indexOf(a,l)<0&&a.push(l)}return a},h.union=function(){return h.uniq(_(arguments,!0,!0,[]))},h.intersection=function(e){if(null==e)return[];for(var t=[],i=arguments.length,n=0,a=e.length;a>n;n++){var o=e[n];if(!h.contains(t,o)){for(var s=1;i>s&&h.contains(arguments[s],o);s++);s===i&&t.push(o)}}return t},h.difference=function(e){var t=_(s.call(arguments,1),!0,!0,[]);return h.filter(e,function(e){return!h.contains(t,e)})},h.zip=function(e){if(null==e)return[];for(var t=h.max(arguments,"length").length,i=Array(t),n=0;t>n;n++)i[n]=h.pluck(arguments,n);return i},h.object=function(e,t){if(null==e)return{};for(var i={},n=0,a=e.length;a>n;n++)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},h.indexOf=function(e,t,i){if(null==e)return-1;var n=0,a=e.length;if(i){if("number"!=typeof i)return n=h.sortedIndex(e,t),e[n]===t?n:-1;n=0>i?Math.max(0,a+i):i}for(;a>n;n++)if(e[n]===t)return n;return-1},h.lastIndexOf=function(e,t,i){if(null==e)return-1;var n=e.length;for("number"==typeof i&&(n=0>i?n+i+1:Math.min(n,i+1));--n>=0;)if(e[n]===t)return n;return-1},h.range=function(e,t,i){arguments.length<=1&&(t=e||0,e=0),i=i||1;for(var n=Math.max(Math.ceil((t-e)/i),0),a=Array(n),o=0;n>o;o++,e+=i)a[o]=e;return a};var w=function(){};h.bind=function(e,t){var i,n;if(u&&e.bind===u)return u.apply(e,s.call(arguments,1));if(!h.isFunction(e))throw new TypeError("Bind must be called on a function");return i=s.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,i.concat(s.call(arguments)));w.prototype=e.prototype;var a=new w;w.prototype=null;var o=e.apply(a,i.concat(s.call(arguments)));return h.isObject(o)?o:a}},h.partial=function(e){var t=s.call(arguments,1);return function(){for(var i=0,n=t.slice(),a=0,o=n.length;o>a;a++)n[a]===h&&(n[a]=arguments[i++]);for(;i_(a/T)&&t("overflow"),y*=T}var E=i.length+1;h=b(l-v,E,0==v),_(l/E)>a-d&&t("overflow"),d+=_(l/E),l%=E,i.splice(l++,0,d)}return String.fromCodePoint.apply(String,i)},y=function(e){return n(e,function(e){return h.test(e)?v(e.slice(4).toLowerCase()):e})};return y(e)},"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return 10>e?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var i,n,a,o,s,r=gap,l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),"function"==typeof rep&&(l=rep.call(t,e,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?l+"":"null";case"boolean":case"null":return l+"";case"object":if(!l)return"null";if(gap+=indent,s=[],"[object Array]"===Object.prototype.toString.apply(l)){for(o=l.length,i=0;o>i;i+=1)s[i]=str(i,l)||"null";return a=0===s.length?"[]":gap?"[\n"+gap+s.join(",\n"+gap)+"\n"+r+"]":"["+s.join(",")+"]",gap=r,a}if(rep&&"object"==typeof rep)for(o=rep.length,i=0;o>i;i+=1)"string"==typeof rep[i]&&(n=rep[i],a=str(n,l),a&&s.push(quote(n)+(gap?": ":":")+a));else for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(a=str(n,l),a&&s.push(quote(n)+(gap?": ":":")+a));return a=0===s.length?"{}":gap?"{\n"+gap+s.join(",\n"+gap)+"\n"+r+"}":"{"+s.join(",")+"}",gap=r,a}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx,escapable,gap,indent,meta,rep;"function"!=typeof JSON.stringify&&(escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(e,t,i){var n;if(gap="",indent="","number"==typeof i)for(n=0;i>n;n+=1)indent+=" ";else"string"==typeof i&&(indent=i);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,JSON.parse=function(text,reviver){function walk(e,t){var i,n,a=e[t];if(a&&"object"==typeof a)for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n=walk(a,i),void 0!==n?a[i]=n:delete a[i]);return reviver.call(e,t,a)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),lc.DefaultWidget=lc.utils.defineClass(function(){this.init=function(){return this.inlineStyles={},this.inlinePresetStyles={},this.productInlineStyles={},this.userQuestion=null,this.main=null,this.leadFormPopupShown=!1,this.setupDefaultValues(),this.applyMixins(),this.previewMode.started=!1,this.greeting.alreadyWritten=!1,this.consultant.generateTitleFromTag=!1,this.consultant.randomGenerated=!1,this.applyServerEnv(),this.applyCustomParamInScript(),this.applyProductSettings(),this.applyCustomParamInScript(),this.initState(),this.initialized=!0,this},this.consts={minimized:"minimized",maximized:"maximized",iframeformtemplate:"",mobileState:"widget-display",scenarioActive:!1,msgtextLength:20,popupURL:"",timeoutTimer:"",placeMesTimeout:""},this.stateCookie=function(){return this.widgetClass+"_"+this.webmaster.product+"_"+this.widgetStyle.style+(null!==this.widget_version?"_"+this.widget_version:"")+(null!==this.widget_id?"_"+this.widget_id:"")},this.statefulFields=function(){return["greeting.alreadyWritten","sizeState","consultant.randomGenerated","consultant.name","consultant.photo","referer","greeting.randomText","revelation.sizeState"]},this.listConsultantNames=function(){return["Роман Беляков","Филипп Андреев","Элла Самойлова","Борис Савин","Елена Беспалова","Любовь Воронова","Станислав Соболев","Никита Воробьев","Дмитрий Панов"]},this.listConsultantPhoto=function(){return[1,2,"j3",4,"j5","j6",7,8,9]},this.element_widget=function(){return this.main.find(".leadia-widget")},this.element_styles=function(){return this.main.find(".leadia-widget-style")},this.element_widgetBody=function(){return this.main.find(".leadia_widget_body")},this.element_header=function(){return this.main.find(".leadia-widget-header")},this.element_headerImg=function(){return this.main.find(".leadia-widget-header-img")},this.element_workerName=function(){return this.main.find(".leadia-widget-worker-name")},this.element_jobTitle=function(){return this.main.find(".leadia-widget-job-title")},this.element_typemessage=function(e){
return"undefined"!=typeof e?e.find(".leadia_msg_typemessage"):this.main.find(".leadia_msg_typemessage")},this.element_textarea=function(){return this.main.find(".leadia-widget-textarea")},this.element_button=function(){return this.main.find(".leadia_widget_btn")},this.element_chatwrapcontent=function(){return this.main.find("#leadia_content_custom_scroll")},this.element_chat=function(){return this.main.find(".leadia_widget_list")},this.element_message=function(e){return e.find(".leadia-widget-message-block")},this.element_messageWrap=function(e){return e.find(".leadia-widget-message-block .msg_wrap")},this.element_messageText=function(e){return e.find(".leadia-widget-message-block .leadia-widget-message-text")},this.element_messageCorner=function(e){return e.find(".leadia-widget-message-block .msg_wrap_corner")},this.element_messageTimeLabel=function(e){return e.find(".leadia-widget-message-block .leadia_msg_time")},this.element_allMessages=function(){return this.element_message(this.element_chat())},this.element_allMessageTimeLabels=function(){return this.element_messageTimeLabel(this.element_chat())},this.element_animatedWriting=function(e){return"undefined"!=typeof e?e.find(".leadia-widget-writetext"):this.main.find(".leadia-widget-writetext")},this.element_animatedWritingAnim=function(){return this.main.find(".leadia-widget-msg-anim")},this.element_animatedWritingPencil=function(){return this.main.find(".leadia-widget-type_msg_pencil")},this.element_animatedWritingCorner=function(){return this.main.find(".leadia-widget-msg_wrap_corner")},this.element_leadFormPopup=function(){return this.main.find(".leadia-widget-popup")},this.element_leadFormPopupIframe=function(){return this.main.find(".leadia-widget-popup-iframe")},this.element_leadFormPopupDarkScreen=function(){return this.main.find(".leadia-widget-popup-dark-screen")},this.element_leadFormPopupClose=function(){return this.main.find(".leadia-widget-popup-close")},this.element_previewModeHorMarg=function(){return this.main.find(".leadia-widget-pm-hor-marg")},this.element_previewModePadLeft=function(){return this.main.find(".leadia-widget-pad-left")},this.element_previewModePadLeftVal=function(){return this.main.find(".leadia-widget-pad-left-val")},this.element_previewModePadRight=function(){return this.main.find(".leadia-widget-pad-right")},this.element_previewModePadRightVal=function(){return this.main.find(".leadia-widget-pad-right-val")},this.style_leadFormPopupShown=function(){return{bottom:"50%","margin-bottom":"-242px",width:this.leadFormPopupStyle.width,height:this.leadFormPopupStyle.height,"border-top-width":"112px"}},this.style_leadFormPopupShownFromLeft=function(){return _.extend(this.style_leadFormPopupShown(),{left:"50%","margin-left":"-263px"})},this.style_leadFormPopupShownFromRight=function(){return _.extend(this.style_leadFormPopupShown(),{right:"50%","margin-right":"-263px"})},this.style_leadFormPopupHidden=function(){return{bottom:"0","margin-bottom":"0",width:"326px",height:"357px","border-top-width":"60px"}},this.style_leadFormPopupHiddenToLeft=function(){return _.extend(this.style_leadFormPopupHidden(),{left:this.widgetStyle.horizontalMargin,"margin-left":"0"})},this.style_leadFormPopupHiddenToRight=function(){return _.extend(this.style_leadFormPopupHidden(),{right:this.widgetStyle.horizontalMargin,"margin-right":"0"})},this.style_leadFormPopupShowAnimation=function(){return"left"==this.widgetStyle.position?this.style_leadFormPopupShownFromLeft():this.style_leadFormPopupShownFromRight()},this.style_leadFormPopupHideAnimation=function(){return"left"==this.widgetStyle.position?this.style_leadFormPopupHiddenToLeft():this.style_leadFormPopupHiddenToRight()},this.p=function(e){return $.proxy(e,this)},this.setTimeout=function(e,t){return setTimeout(this.p(e),t)},this.setInterval=function(e,t){return setInterval(this.p(e),t)},this.setCookie=function(e,t,i){return i="undefined"!=typeof i?i:86400,lc.utils.setCookie(e,t,{expires:i,path:"/"})},this.getCookie=function(e){return lc.utils.getCookie(e)},this._setValue=function(e,t){this[e]=t},this._getValue=function(e){return this[e]},this.getConfigFromServerEnv=function(){return function(e){var t={staticFilesUrl:e.static,webmaster:{product:e.params.product,userId:e.userid,subaccount:e.subaccount,userHash:e.params.user_hash},widget_id:e.params.widget_id,default_widget_id:e.params.default_widget_id?e.params.default_widget_id:void 0,server:{protocol:e.params.protocol,host:e.params.host},geohead:e.params.geohead,generateRandomConsultant:e.params.robotrandom,widgetStyle:{style:e.params.style?e.params.style:"default",position:e.params.position?e.params.position:void 0,horizontalMargin:e.params.margin?e.params.margin:void 0,showCallBtn:!1,delaytype:e.params.delaytype?e.params.delaytype:void 0,bottom:void 0!==e.params.bottom&&null!==e.params.bottom?e.params.bottom:void 0},presetStyle:e.params.custom_color?e.params.custom_color:void 0,previewMode:{on:e.params.preview_mode?e.params.preview_mode:void 0,step:e.params.preview_mode_step},nocookie:e.params.no_cookie?e.params.no_cookie:void 0,form:{template:e.params["form-template"]?e.params["form-template"]:"fabricform",mobileForm:e.params["mobile-form"]},widgetClass:e.params["widget-class"]?e.params["widget-class"].replace(/\//gi,"_"):"leadia_default",jsonModelConfig:e.params.widget_json_settings,client:{ip:e.params.client_ip,widgetTemplate:e.params.template_full},lead_to_email:e.params.lead_to_email?e.params.lead_to_email:"ON",mobile_widget:e.params.mobile_widget?e.params.mobile_widget:1,settings:{msgsound:e.params.msgsound?e.params.msgsound:0,flipisactive:e.params.flipisactive?e.params.flipisactive:0,copyright_status:e.params.copyright_status?e.params.copyright_status:0,language:e.params.language?e.params.language:"ru_RU",termsofuse:e.params.termsofuse?e.params.termsofuse:0,social_auth:e.params.social_auth||0},widget_version:e.params.widget_version?e.params.widget_version:"1.0",analytics:{ga_id:e.params.ga_id,metrics_id:e.params.metrics_id},entertextlimit:e.params.entertextlimit?e.params.entertextlimit:5,user_filter:null!=e.params.user_filter&&e.params.user_filter.data&&1==e.params.user_filter.status?e.params.user_filter.data:"",styles3d:{gradient_active:0,gradient:"",border_radius_active:0,border_radius:"",box_shadow_active:0,"box-shadow":""},userPhone:e.params.userPhone?e.params.userPhone:""};return e.params.consultant_name&&(t.consultant={},t.consultant.name=e.params.consultant_name),e.params.consultant_jobTitle&&(t.hasOwnProperty("consultant")||(t.consultant={}),t.consultant.jobTitle=e.params.consultant_jobTitle),e.params.consultant_photo&&(t.hasOwnProperty("consultant")||(t.consultant={}),t.consultant.photo=e.params.consultant_photo),e.params.greeting_text&&(t.greeting={},t.greeting.text=e.params.greeting_text),e.params.thankpage_text&&(t.thankpage_text=e.params.thankpage_text),e.params.thankpage_photo&&(t.thankpage_photo=e.params.thankpage_photo),e.params.form_field_json&&(t.form_field_json=e.params.form_field_json),e.params.flipconfig_json&&(t.flipconfig_json=e.params.flipconfig_json),e.params.styles3d&&(t.styles3d=e.params.styles3d),e.params.scenario&&(t.scenario=e.params.scenario),e.params.always_minimized&&(t.always_minimized=e.params.always_minimized),e.params.global_settings&&(t.widget_global_settings=e.params.global_settings),t}(lc.serverEnv)},this.setupDefaultValues=function(){this.showPopupOnEachMessage=!1,this.previewMode={on:!1,showHorizontalMargins:!1},this.referer=document.referrer,this.webmaster={userId:null,subaccount:null,product:null},this.widgetStyle={position:"right",horizontalMargin:"0"},this.presetStyle="blue",this.server={protocol:"http",host:"cloud.leadia.ru"},this.leadFormPopupStyle={width:525,height:525},this.placeholders={textarea:"Введите ваше сообщение ..."},this.greeting={text:"Здравствуйте! Я могу бесплатно вас проконсультировать. Введите ваш вопрос.",delaySeconds:7,randomText:0},this.consultant={jobTitle:"юрист-консультант",generateRandom:!0,name:"Михаил Лаврентьев",photo:"9",generateTitleFromTag:!1,typeMessage:"Юрист печатает вам сообщение!"},this.sizeState=this.consts.minimized,this.revelation={sizeState:""},this.thankpage_photo="https://133921.selcdn.ru/widget/system/gala_72.png",this.contactform_text="Оставьте свои контактные данные, и мы ответим на ваш вопрос.",this.flipconfig_json={texts:{title:"Закажите звонок!",subtitle:"Мы перезвоним в удобное время.",textbeforeform:"Выберите время и оставьте номер телефона, мы вам перезвоним.",buttontext:"Жду звонка"},flip_timeout:10,photo:"https://133921.selcdn.ru/widget/system/call.png"}},this.getProductSettings=function(){return{}},this.applyProductSettings=function(){var e=this.getProductSettings();void 0!=e[this.webmaster.product]&&$.extend(!0,this,e[this.webmaster.product])},this.applyMixins=function(){void 0!==this.mixins&&$.extend(!0,this,this.mixins)},this.applyServerEnv=function(){$.extend(!0,this,this.getConfigFromServerEnv())},this.applyCustomParamInScript=function(){"undefined"!=typeof leadia_custom_param&&$.extend(!0,this,leadia_custom_param)},this.initState=function(){var e;try{this.storage=new lc.components.utils.LS(this.stateCookie()),this.banstorage=new lc.components.utils.LS;var t=this.storage.get("_user_msg_time");this.widgetVersion&&this.storage.set("_version",this.widgetVersion),t&&this.storage.get("_version")===this.widgetVersion&&lc.utils.amountDaysBetweenTwoDates(new Date,new Date(t))>=1&&this.storage.clear()}catch(e){}if(1!=parseInt(this.nocookie)&&(e=this.getCookie(this.stateCookie())),e){_.each(this.statefulFields(),this.p(function(e){var t=this.getCookie(this.getStateCookieName(e));if(void 0!==t)try{lc.utils.setField(this,e,t)}catch(e){}}))}else this.saveState()},this.getState=function(){var e={};return _.each(this.statefulFields(),this.p(function(t){e[t]=lc.utils.getField(this,t)})),e},this.getStateCookieName=function(e){return this.stateCookie()+"_"+e},this.saveState=function(){var e=this.getState();_.each(e,this.p(function(e,t){this.setCookie(this.getStateCookieName(t),e)})),this.setCookie(this.stateCookie(),"1")},this.setSizeState=function(e){this.sizeState=e,this.saveState(),this.updateView()},this.minimize=function(){this.setSizeState(this.consts.minimized)},this.maximize=function(){this.setSizeState(this.consts.maximized)},this.toggleSizeState=function(){this.sizeState==this.consts.minimized?this.maximize():this.minimize()},this.getRandomConsultant=function(){var e=lc.utils.getRandomItemIndex(this.listConsultantPhoto()),t=this.listConsultantNames()[e],i=this.listConsultantPhoto()[e];return{name:t,photoName:i}},this.setupRandomConsultant=function(){if(!this.consultant.randomGenerated){var e=this.getRandomConsultant();this.consultant.name=e.name,this.consultant.photo=e.photoName,this.consultant.randomGenerated=!0,this.saveState()}},this.generateTitleFromTag=function(){var e,t={"алимент":"алиментов","договор":"договора","документ":"документов","квартир":"квартиры","хищени":"хищения","налог":"налогов","наследств":"наследства","долг":"долгов","мошенничеств":"мошенничества","недвижимост":"недвижимости","пенси":"пенсии","брак":"брака","развод":"развода","льгот":"льгот","штраф":"штрафов","дтп":"ДТП","суд":"суда","жалоб":"жалобы","спор":"споров","увольнени":"увольнения","взятк":"взятки","шантаж":"шантажа","арест":"ареста","затоплени":"затопления","арбитраж":"арбитража","апелляци":"апелляции","взыскани":"взыскания","ооо":"ООО","зао":"ЗАО","кредит":"кредита","банк":"банков","ребенок":"детей","преступлен":"преступлений","возврат":"возврата","страховани":"страхования"};document.title.toLowerCase();for(var i in t)if(documentTile.indexOf(i)!==-1){e="Здравствуйте! Я могу вас проконсультировать по поводу "+t[i]+". Введите ваш вопрос.";break}e&&(this.consultant.jobTitle=e)},this.__setupInlineStyles=function(e,t){_.each(e,this.p(function(e,i){t.find(i).css(e)}))},this.setupInlineStyles=function(e){this.__setupInlineStyles(this.inlineStyles,e),void 0!==this.productInlineStyles[this.webmaster.product]&&this.__setupInlineStyles(this.productInlineStyles[this.webmaster.product],e),void 0!==this.inlinePresetStyles[this.presetStyle]&&this.__setupInlineStyles(this.inlinePresetStyles[this.presetStyle],e)},this.createMainBlock=function(){return this.main=$(""),this.main.append($("").addClass("leadia-widget-style").html(this.inclusionStyles)),this.main.append(this.widgetHtml),this.previewMode.on||(this.consultant.generateRandom&&this.setupRandomConsultant(),this.consultant.generateTitleFromTag&&this.generateTitleFromTag(),this.geohead&&this.setupRegionSpecHeader()),this.resetView(),this.applyInteractionHandlers(),this.main},this.setMessageBlockContent=function(e,t,i,n,a,o){if("object"==typeof t)for(t in obj){var s=obj[t].msgText;this.setMessageBlockContent(this.main,s,i,n,a,o),countText+=1}else void 0!==t&&(void 0!==typeof n&&n?"object"==typeof a&&"number"==typeof a.elPos?this.element_messageText(e).eq(a.elPos).html(t):this.element_messageText(e).html(t):this.element_messageText(e).text(t)),void 0!==i&&(this.element_messageTimeLabel(e).attr("data-time",i),this.updateSendTime()),"function"==typeof o&&o()},this.createDetachedMessageBlock=function(e){var t=$(""),i=$(this.messageHtml);return t.append(i),this.setMessageBlockContent(t,e.msgText,e.msgTime?e.msgTime:new Date($.now())),e.isMe?i.addClass("leadia-widget-message-me"):i.addClass("leadia-widget-message-he"),this.setupInlineStyles(t),i},this.applyInteractionHandlers=function(){this.previewMode.on||(this.element_header().click(this.p(function(){this.toggleSizeState()})),this.element_textarea().focus(this.p(function(){this.element_textarea().css({height:"80px",outline:"0 none"})})),this.element_textarea().blur(this.p(function(){0==this.element_textarea().val().length&&this.element_textarea().css({height:"37px"})})),this.element_textarea().keypress(this.p(function(e){var t=e.keyCode?e.keyCode:e.which;if(13==t)return this.placeEnteredMessage(),!1})),this.element_button().click(this.p(function(){this.placeEnteredMessage()})),this.element_leadFormPopupClose().click(this.p(this.hideLeadFormPopup)))},this.resetView=function(e){e="undefined"!=typeof e?e:"",this.setupInlineStyles(this.main),this.initializeView(e)},this.updateView=function(){if(!this.leadFormPopupShown&&!this.previewMode.on)if(this.sizeState==this.consts.minimized){var e=this.element_widget().height()-this.element_header().height();this.element_widget().css("bottom","-"+e+"px")}else this.element_widget().css("bottom",0)},this.initializeView=function(e){if(e="undefined"!=typeof e&&e.length>0?e:"","left"==this.widgetStyle.position?this.element_widget().css({left:this.widgetStyle.horizontalMargin}):this.element_widget().css({right:this.widgetStyle.horizontalMargin}),this.element_leadFormPopup().attr("style",function(e,t){return t+"overflow: visible !important;"}),this.element_leadFormPopupIframe().width(this.leadFormPopupStyle.width),this.element_leadFormPopupIframe().height(this.leadFormPopupStyle.height),this.element_headerImg().attr("src",this.getConsultantPhotoUrl(this.consultant.photo)),this.element_workerName().text(this.consultant.name),this.element_jobTitle().text(this.consultant.jobTitle),this.element_typemessage().text(this.consultant.name.split(" ")[0]+" печатает вам сообщение!"),this.element_textarea().attr("placeholder",this.placeholders.textarea),this.previewMode.on){if(lc.utils.waitFor(this.p(function(){return lc.utils.css(this.element_styles(),this.element_widget()).width}),this.p(function(e){this.previewMode.showHorizontalMargins?(this.element_previewModeHorMarg().show(),"left"==this.widgetStyle.position?(this.element_previewModePadRight().hide(),this.element_previewModePadLeft().show(),this.element_previewModePadLeft().css({right:"50%","margin-right":+(this.element_widget().width()/2+5),"margin-left":0}),this.element_previewModePadLeftVal().text(this.widgetStyle.horizontalMargin)):(this.element_previewModePadLeft().hide(),this.element_previewModePadRight().show(),this.element_previewModePadRight().css({left:"50%","margin-left":+(this.element_widget().width()/2+25),"margin-right":0}),this.element_previewModePadRightVal().text(this.widgetStyle.horizontalMargin))):this.element_previewModeHorMarg().hide(),this.element_widget().css({left:"50%","margin-left":-this.element_widget().width()/2,bottom:0})})),"venyoo"==e)if(lc.utils.checkIsJson(this.greeting.text))try{countText=0,obj=JSON.parse(this.greeting.text);for(text in obj){var t={msgText:obj[text].msgText,isMe:!0,scrollFast:!0,writing:0,msgTime:""},i=this.createDetachedMessageBlock(t);countText++?this.element_chat().append(i):this.element_chat().html(i),countText+=1}this.updateSendTime()}catch(e){this.setMessageBlockContent(this.main,this.greeting.text)}else this.setMessageBlockContent(this.main,this.greeting.text)}else this.element_previewModeHorMarg().hide(),"left"==this.widgetStyle.position?this.element_widget().css({left:this.widgetStyle.horizontalMargin+"px",bottom:0}):this.element_widget().css({right:this.widgetStyle.horizontalMargin+"px",bottom:0}),this.element_textarea();this.updateView()},this.setGreetingAlreadyWrittenTrue=function(){this.greeting.alreadyWritten="1",this.saveState()},this.placeGreetingMessageNow=function(){this.placeMessage({msgText:this.greeting.text,isMe:!0,writing:0,scrollFast:!0},!0),this.updateView()},this.startScenario=function(){this.setTimeout(function(){this.placeMessageFromRobot({msgText:this.greeting.text,writing:7}),this.maximize(),this.setGreetingAlreadyWrittenTrue()},1e3*this.greeting.delaySeconds)},this.doJsonStartScenario=function(e,t){"undefined"!=typeof Object.keys(e)[t]?this.setTimeout(function(){0==t&&this.maximize(),this.placeMessageFromRobot({msgText:e[Object.keys(e)[t]].msgText,writing:e[Object.keys(e)[t]].writing}),t+=1,this.doJsonStartScenario(e,t)},1e3*e[Object.keys(e)[t]].waiting):this.setGreetingAlreadyWrittenTrue()},this.updateSendTime=function(){this.element_allMessageTimeLabels().each(function(){var e=new Date($(this).data("time")),t=new Date,i=e.getTime()-t.getTime(),n=Math.ceil(Math.abs(i/1e3));if(n<30)$(this).text("Только что");else if(n<60)$(this).text("30 секунд назад");else if(n<=300){var a=Math.floor(n/60),o="";switch(a){case 1:o="минуту назад";break;case 2:o="2 минуты назад";break;case 3:o="3 минуты назад";break;case 4:o="4 минуты назад";break;case 5:o="5 минут назад"}$(this).text(o)}else $(this).text("Отправлено в "+("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2))})},this.scrollToBottom=function(e){var t=e?{scrollInertia:0}:void 0;this.setTimeout(function(){this.element_chatwrapcontent().mCustomScrollbar("scrollTo","bottom",t)},50)},this.showAnimatedWriting=function(e){this.element_chat(e).append(this.element_animatedWriting(e).show())},this.hideAnimatedWriting=function(e){this.element_animatedWriting(e).hide()},this.placeMessageFromRobot=function(e,t,i){e.isMe="undefined"==typeof e.isMe||e.isMe;var n=void 0!=e.activeEl?e.activeEl:void 0;this.showAnimatedWriting(n),this.scrollToBottom(Boolean(e.scrollFast),n),this.consts.placeMesTimeout=this.setTimeout(function(){this.hideAnimatedWriting(n),this.placeMessage(e,t,i)},1e3*e.writing)},this.placeMessage=function(e,t,i){void 0===t&&(t=!1);var n=this.createDetachedMessageBlock(e),a=void 0!=e.activeEl?e.activeEl:void 0;n.hide(),this.element_chat(a).append(n);var o=this.element_chat(a).find(".leadia_widget_msg").last();e.fadeEvent?o.fadeIn(400,this.p(function(){"function"==typeof i&&i()})):(o.show(),"function"==typeof i&&i());try{if(e.isMe&&1==this.settings.msgsound&&e.writing>0)if(this.main.find("#leadia_widget_sound").length>0)this.main.find("#leadia_widget_sound")[0].play();else{var s=$("",{id:"leadia_widget_sound",src:"https://133921.selcdn.ru/widget/audio/pop2.mp3",preload:"auto",autoplay:"true"});this.main.append(s)}}catch(e){}void 0!=e.showBell&&e.showBell&&"function"==typeof this.bellHandler&&this.checkAppsFlip(a)&&this.bellHandler().bShow(),this.updateSendTime(),t||this.maximize(),this.scrollToBottom(Boolean(e.scrollFast),a)},this.checkAppsFlip=function(e){try{return void 0!=e&&"function"==typeof this.appsFlip&&e.attr("id")=="_"+this.appsFlip().getState()}catch(e){return!1}},this.place=function(){return this.initialized||this.init(),this.createMainBlock(),$(this.p(function(){$("body").append(this.main),this.element_widget().hide(),lc.utils.waitFor(this.p(function(){return!$.isEmptyObject(lc.utils.css(this.element_styles(),this.element_widget()))}),this.p(function(){this.element_widget().show(),this.previewMode.on?this.processPreviewMode():(this.greeting.alreadyWritten?this.placeGreetingMessageNow():this.startScenario(),this.setInterval(this.updateSendTime,3e4)),setTimeout(this.p(function(){this.element_chatwrapcontent().mCustomScrollbar({axis:"y",theme:"dark-2"})}),1500),this.resetView()}))})),this},this.processPreviewMode=function(){this.maximize(),this.placeGreetingMessageNow()},this.getServerUrl=function(e,t){return this.server.protocol+"://"+this.server.host+(e?e:"")+(t?"?"+$.param(t):"")},this.getServerOrigin=function(){return this.getServerUrl("")},this.getStaticFileUrl=function(e){return this.staticFilesUrl+e},this.getConsultantPhotoUrl=function(e){return/^j?\d+$/.test(e)?"https://133921.selcdn.ru/widget/faces/40/"+e+".png":e},this.placeEnteredMessage=function(){var e=this.element_textarea().val();0!=$.trim(e).length&&(this.element_textarea().val(""),this.placeMessage({msgText:e,isMe:!1}),this.element_textarea().focus(),this.triggerRobotReplyScenario(e))},this.sendRef=function(){this.referer&&$.ajax({url:this.getServerUrl("/widget/ref"),type:"post",dataType:"jsonp",data:{referer:this.referer}})},this.getLeadFormPopupUrl=function(e){var t=encodeURI(document.referrer);return t.length>110&&(t=t.match(/:\/\/(.[^\/]+)/)[1]),window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),this.consts.popupURL=this.getServerUrl("/",{t:"widget",ft:"robot",p:this.webmaster.product,q:e?e.substring(0,301):"",w:this.webmaster.userId,sub:this.webmaster.subaccount,referer:t,po:window.location.origin,color:this.element_widget().css("background-color").replace(/#/g,""),h:this.getCookie("leadia_hash"),s:this.iframeformtemplate,widget_id:this.widget_id,custom_photo:this.consultant.randomGenerated?this.consultant.photo:""}),this.consts.popupURL},this.getPopupURL=function(){return this.consts.popupURL},this.setPopupURL=function(){return this.getPopupURL()},this.animateShowLeadFormPopup=function(){this.element_leadFormPopup().css({"z-index":"99999998"}).show(),this.element_leadFormPopupDarkScreen().show(),this.element_leadFormPopup().animate(this.style_leadFormPopupShowAnimation(),700,this.p(function(){var e=this.p(function(){this.element_leadFormPopupClose().show(),this.element_leadFormPopup().css({"border-width":0,"border-top-width":0}),this.element_leadFormPopupIframe().show(),this.element_leadFormPopupIframe().off("load",e)});this.element_leadFormPopupIframe().load(e),this.setupLeadFormPopupIframeSrc()})),this.element_widget().hide(100),this.element_textarea().blur()},this.animateHideLeadFormPopup=function(e){this.element_leadFormPopupDarkScreen().hide(),this.element_leadFormPopup().css({"border-width":"8px","border-top-width":"112px"}),this.element_leadFormPopup().animate(this.style_leadFormPopupHideAnimation(),700,e),this.element_leadFormPopupIframe().hide(),this.element_leadFormPopupClose().hide(),this.setTimeout(function(){this.element_widget().show(),this.scrollToBottom(!0),this.element_leadFormPopup().fadeOut()},500)},this.setupLeadFormPopupIframeSrc=function(){this.getLeadFormPopupUrl(this.userQuestion);var e=this.setPopupURL();this.element_leadFormPopupIframe().attr("src",e)},this.showLeadFormPopup=function(e,t,i){this.iframeformtemplate="undefined"!=typeof t&&null!=t?t:this.form.template,this.userQuestion=e,this.sendRef(),this.animateShowLeadFormPopup(),this.showPopupOnEachMessage="undefined"==typeof i||i,this.leadFormPopupShown=!0},this.hideLeadFormPopup=function(){this.animateHideLeadFormPopup(this.p(function(){this.leadFormPopupShown=!1,this.scrollToBottom(!0)}))},this.textScenarionRobotReplay={t1:{msgText:"Давайте я отвечу Вам по телефону. Это существенно ускорит процесс.",writing:7,waiting:5},t2:{msgText:"Сейчас всплывет окно. Оставьте в нем свои контактные данные.",writing:6,waiting:9}},this.doSetTimeout=function(e,t,i){"undefined"!=typeof Object.keys(t)[i]?this.setTimeout(function(){this.placeMessageFromRobot({msgText:t[Object.keys(t)[i]].msgText,writing:t[Object.keys(t)[i]].writing}),i+=1,this.doSetTimeout(e,t,i)},1e3*t[Object.keys(t)[i]].waiting):this.setTimeout(function(){this.showLeadFormPopup(e)},1e3*(t[Object.keys(t)[i-1]].writing+7))},this.triggerRobotReplyScenario=function(e){this.showPopupOnEachMessage?this.showLeadFormPopup(this.userQuestion?this.userQuestion:e):e.length>this.consts.msgtextLength&&(this.consts.scenarioActive||(this.consts.scenarioActive=!0,Object.keys(this.textScenarionRobotReplay).length>0&&(this.consts.timeoutTimer&&clearTimeout(this.consts.timeoutTimer),this.doSetTimeout(e,this.textScenarionRobotReplay,0))))},this.sendStat=function(){try{var e=document.URL,t=document.location.host,i=document.title,n=md5(e+""+t+i);$.ajax({type:"post",data:{url:e,domain:t,title:i,hash:n},url:this.getServerUrl("/statTitleDomain")});var a=new Date;a.setTime(a.getTime()+31536e7);"expires="+a.toUTCString();document.cookie="leadia_hash="+n+"; expires="+a.toUTCString()}catch(e){}},this.setupRegionSpecHeader=function(){$.ajax({url:this.getServerUrl("/geo"),success:this.p(function(e){"undefined"!=typeof e&&e.length>1&&65279!=e.charCodeAt(0)&&this.element_jobTitle().html("Юрист-консультант ("+e+")")})})},this.goalMapping=function(e){var t={trywriteenabled:"venyoo-message-typing",sendmessage:"venyoo-message-sent",contacttyping:"venyoo-contacts-typing",sendlead:"venyoo-lead-sent",leadsendcallform:"venyoo-callform-lead",clicktextarea:"leadia_clicktextarea",expand:"leadia_expand",collapse:"leadia_collapse",widgethover:"leadia_widgethover",opencoldpopup:"leadia_opencoldpopup",yesbtncoldpopup:"leadia_yesbtncoldpopup",nobtncoldpopup:"leadia_nobtncoldpopup",btnsettings:"leadia_btnsettings",chatclickhovermen:"leadia_chatclickhovermen",callclickhovermenu:"leadia_callclickhovermenu",bannerfinalstepclick:"leadia_bannerfinalstepclick",showphonenumber:"leadia_showphonenumber",widgetthemedetect:"leadia_widgetthemedetect",changewidgetthemedetect:"leadia_changewidgetthemedetect",widgetsuccessloaded:"leadia_widgetsuccessloaded",widgeterrorloaded:"leadia_widgeterrorloaded"};return"sportmaster"===this.webmaster.product&&(t.expand="show",t.collapse="hide",t.sendlead="call_me",t.interaction="interaction",t.close="close"),"undefined"!=typeof t[e]?t[e]:null},this.goalTrigger=function(e,t){try{lc.loader&&lc.loader.utils&&"function"==typeof lc.loader.utils.goalTrigger&&(~this.widgetClass.indexOf("venyoo")<0||"leadia_default_blade"==this.widgetClass&&"lawyer"==this.webmaster.product)?lc.loader.utils.goalTrigger(e):"undefined"!=typeof t&&t.get(0).contentWindow.postMessage(e,this.server.protocol+"://s3-eu-west-1.amazonaws.com")}catch(e){console.log(e)}var i=this.goalMapping(e);null!==i&&(lc.utils.gaTriggerGoal(i),lc.utils.metricsTriggerGoal(i))}}),lc.VenyooWidget=lc.utils.defineClass(lc.DefaultWidget,function(){this.initState=function(){this.consts.firstMsgTimer=null,this.statefulFields=function(){return["greeting.alreadyWritten","sizeState","referer","widgetFirstOpen"]},this.firstMessageMode=function(){return!("undefined"==typeof this.manualCollapseWidget||!this.manualCollapseWidget)},this.doJsonStartScenario=function(e,t,i,n){"undefined"!=typeof Object.keys(e)[t]?(clearTimeout(this.consts.firstMsgTimer),this.consts.firstMsgTimer=this.setTimeout(function(){0==t&&this.sizeState==this.consts.minimized&&this.maximize(),this.placeMessageFromRobot({msgText:e[Object.keys(e)[t]].msgText,writing:"undefined"!=typeof i?i["msg_"+(t+1)+"_complete"]:e[Object.keys(e)[t]].writing,activeEl:n},this.firstMessageMode(),"undefined"!=typeof Object.keys(e)[t+1]?this.p(function(){this.callgoalTrigger("send"+t+"greeting_msg"),t+=1,this.chat&&!this.chat.chatInitialized&&this.chat.sendRobotMessage(e[Object.keys(e)[t]].msgText),this.doJsonStartScenario(e,t,i,n)}):this.p(function(){this.callgoalTrigger("send"+t+"greeting_msg"),this.chat&&!this.chat.chatInitialized&&this.chat.sendRobotMessage(e[Object.keys(e)[t]].msgText,!1,t),lc.utils.removeFromLocalStorage(this.stateCookie()+"_events"),this.setGrettingTrueAndShowIconMinimize()}))},"undefined"!=typeof i?1e3*i["msg_"+(t+1)+"_waiting"]:3e3)):(lc.utils.removeFromLocalStorage(this.stateCookie()+"_events"),this.setGrettingTrueAndShowIconMinimize())},this.placeGreetingMessageNow=function(e){if(lc.utils.checkIsJson(this.greeting.text)){var t=JSON.parse(this.greeting.text);if(Object.keys(t).length>0)for(items in t)this.placeMessage({msgText:t[items].msgText,isMe:!0,writing:0,scrollFast:!0,activeEl:e},!0)}else this.placeMessage({msgText:this.greeting.text,isMe:!0,writing:0,scrollFast:!0,activeEl:e},!0);"ON"!=this.lead_to_email||null!=this.widget_version&&"1.0"!=this.widget_version||this.getFromLocalStorage()},lc.DefaultWidget.methods.initState.call(this)},this.setGrettingTrueAndShowIconMinimize=function(){this.setGreetingAlreadyWrittenTrue(),this.sizeState!=this.consts.minimized&&this.element_header().find(".leadia_widget_minimize").fadeIn()},this.hideLeadFormPopup=function(){lc.DefaultWidget.methods.hideLeadFormPopup.call(this),"venyoo_default_science"==this.widgetClass&&"ON"==this.lead_to_email&&(this._getValue("leadSend")||(this.sendToEmail({animmsg:!0}),this.disableWriteText()))},this.processPreviewMode=function(){this.maximize(),this.placeGreetingMessageNow()},this.setgetLeadStatus=function(){return function(e,t){var i="lead_sent",n="lead_sent_time",a=e.stateCookie();return{isAvailable:function(){if(this.isStorage())if(null!=localStorage.getItem(a+"_"+n)){if(!(t.utils.amountDaysBetweenTwoDates(new Date,new Date(localStorage.getItem(a+"_"+n)))>=1))return!0;t.utils.removeFromLocalStorage(a+"_"+i)}else t.utils.removeFromLocalStorage(a+"_"+i);return!1},isStorage:function(){return"undefined"!=typeof Storage},getVar:function(){return this.isStorage()&&this.isAvailable()&&null!=localStorage.getItem(a+"_"+i)?localStorage.getItem(a+"_"+i):0},setVar:function(){this.isStorage()&&(localStorage.setItem(a+"_"+i,1),localStorage.setItem(a+"_"+n,new Date))}}}(this,lc)},this.element_developeBy_ctrl=function(){return function(e){return{isExist:function(){return"function"==typeof e.element_developeBy&&e.element_developeBy().length>0},init:function(){if(this.isExist()){var t="";e.settings.copyright_status&&(t="Отдел по работе с клиентами "+(e.server.host.indexOf("api.venew.io")!==-1?"Venew":"Venyoo")),e.element_developeBy().append(this.tpl(t)),e.settings.copyright_status?this.applyEvent():e.element_developeBy().find(".leadia_develop_container").css({cursor:"default"})}},tpl:function(e){return'e.length)throw new RangeError("Index out of range")}function N(e,t,i,n){t<0&&(t=65535+t+1);for(var a=0,o=Math.min(e.length-i,2);a0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),">>=0,i=void 0===i?this.length:i>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}if(!a(t))throw TypeError("listener must be a function");var n=!1;return i.listener=t,this.on(e,i),this},n.prototype.removeListener=function(e,t){var i,n,o,r;if(!a(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=this._events[e],o=i.length,n=-1,i===t||a(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(i)){for(r=o;r-- >0;)if(i[r]===t||i[r].listener&&i[r].listener===t){n=r;break}if(n<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){
for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[e],a(i))this.removeListener(e,i);else if(i)for(;i.length;)this.removeListener(e,i[i.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(a(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},{}],6:[function(e,t,i){i.read=function(e,t,i,n,a){var o,s,r=8*a-n-1,l=(1<
\n\tЦели, в которых я предоставляю Согласие:\n
\n\n\tИдентификация стороны в рамках соглашений и договоров с сайтом проекта «Venyoo»;\n
\n\n\tПредоставление пользователю персонализированных услуг и сервисов;\n
\n\n\tСвязь с пользователем, в том числе направление уведомлений, запросов и информации, касающихся использования сайта, оказания услуг, а также обработка запросов и заявок от пользователя;\n
\n\n\tУлучшение качества проекта «Venyoo», удобства его использования, разработка новых сервисов и услуг;\n
\n\n\tПроведение статистических и иных исследований на основе обезличенных данных.\n
\n\n\tДалее по тексту настоящего Согласия категории и перечень обрабатываемых Данных, категории субъектов, Данные которых обрабатываются, способы, сроки их обработки и хранения, порядок уничтожения Данных при достижении целей их обработки или при наступлении иных законных оснований, распространяются в отношении каждой из вышеуказанных Целей обработки персональных Данных.\n
\n\n\tЯ согласен на получение сообщений информационного характера по смс и электронной почте.\n
\n\n\tЯ подтверждаю, что Оператор вправе использовать мои персональные данные, а равно иные контактные данные, предоставленные мною Оператору, для взаимодействия со мной и иными контактными лицами посредством использования телефонной связи, средств электронной почты, сервисов мгновенных сообщений, социальных сетей и любых иных каналов коммуникации, ставших известными Оператору.\n
\n\n\tДействия по обработке Данных для реализации каждой из вышеуказанных Целей обработки персональных данных:\n\n
\n\tСрок, на который я предоставляю Согласие: Настоящее Согласие дает Оператору право обрабатывать указанные в настоящем Согласии категории моих персональных данных для достижения перечисленных выше целей в течение сроков обязательного хранения документов, установленных законодательством Российской Федерации, а также в течение 3-х (трех) лет после окончания указанных сроков. Достижение некоторых целей обработки данных не лишает Операторов права обрабатывать указанные в настоящем Согласии категории персональных данных для достижения иных целей, указанных выше.\n
\n\n\tЯ подтверждаю, что мне разъяснены и понятны следующие юридические последствия:\n
\n\n\tВ случае моего отказа от предоставления Согласия на обработку Данных, в случае отзыва мной Согласия на обработку Данных, вышеуказанные Цели обработки персональных данных не будут достигнуты.\n
\n\n\tПорядок отзыва Согласия: Настоящее Согласие может быть отозвано мною путем подачи письменного заявления Оператору по установленной форме не менее чем за 7 (семь) рабочих дней до момента отзыва Согласия.\n\tЗаявление об отзыве настоящего Согласия может быть подано только мною лично, для чего мне необходимо явиться в офис Оператора с основным документом, удостоверяющим мою личность, и подать сотруднику соответствующее письменное заявление.\n
\n\n\tНастоящее Согласие может быть также отозвано путем направления заявления об отзыве Согласия по указанному выше адресу Оператора (в нем должны быть указаны мои паспортные данные, а моя подпись на заявлении должна быть заверена нотариально).\n
\n\n\tДополнительные условия Согласия: В случае предоставления мною Оператору персональных данных третьих лиц я гарантирую, что мною было получено согласие этих лиц на передачу их персональных данных Оператору и обработку ими этих персональных данных на условиях, предусмотренных настоящим Согласием.\n
\n\n\tВ случае предоставления Оператору персональных данных третьих лиц в отсутствие их согласия, а равно в случае предоставления Оператору персональных данных третьих лиц под видом моих собственных персональных данных, я обязуюсь в полном объеме компенсировать Оператору убытки, причиненные им в связи с обработкой таких персональных данных. В частности, я обязуюсь возместить причиненный Оператору ущерб, выразившийся в суммах гражданско-правовых компенсаций или административных штрафов, обязанность по уплате которых может быть возложена на Оператора в связи с обработкой персональных данных третьих лиц без получения их согласий.\n\n
\n\n\tНастоящим я отдельно подтверждаю свое согласие (в том числе, в отношении ранее направленных мне материалов) на направление мне информации по сетям электросвязи, в том числе посредством использования телефонной, факсимильной, подвижной радиотелефонной связи любыми способами и в любом объеме.\n
\n\n\tТакже настоящим отдельно подтверждаю свое согласие (в том числе, в отношении ранее возможно собранных данных) на сбор и обработку в вышеуказанных целях любой технической информации. Оператор вправе обрабатывать данные, автоматически получаемые http-сервером в ходе использования мной Сайта Оператора (IP-адрес, вид операционной системы, статистика посещений отдельных страниц сайта и иная подобная информация), информацию, автоматически получаемую при доступе к сайтам Оператора с использованием закладок (“cookies”), а также иные данные, характеризующие мою активность в ходе использования Сайта Оператора.\n\n
',lc.BladeAppearance.mixins.checkboxFieldController=function(e){var t=this;return{init:function(e){e="object"==typeof e&&null!==e?$.extend(!0,{},t.form_field_json,e):$.extend(!0,{},t.form_field_json);var i={fields:{phone:{visible:0},email:{visible:0}}},n="number"==typeof e.writing?e.writing:5,a=!!e.fromLocalstorage,o="Как я могу с вами связаться, чтобы ответить?",s=!1;for(var r in e.fields)i.fields[r]&&(i.fields[r].visible=e.fields[r].visible,i.fields[r].checked=e.fields[r].checked,e.fields[r].visible&&(o=e.fields_text[r+"_text"]));i.fields.phone.visible&&i.fields.email.visible||"boolean"==typeof e.viewcheckbox?o=e.fields_text.phone_email_text:s=!0,this.placeMessage(n,i,a,{title:o,onlytext:s})},placeMessage:function(i,n,a,o){var s={messageType:"feedback-selection",isMe:!0,writing:i,scrollFast:a,isHtml:!0,showBell:!a&&i>0,activeEl:e,title:o.title,fields:n,isFromLS:a,onlytext:o.onlytext};t.locale&&(s.locale=t.locale),t.placeMessageFromRobot(s,!0,function(){("boolean"==typeof a&&!a||"boolean"!=typeof a)&&0===e.find(".leadia_msg_checkboxes").find("input[type=checkbox].leadia_msg_checkbox").length&&(t.storeToLocalStorage({step2:{blockText:s.title,activefields:n,complete:!0}}),t.setTimeout(function(){t.setScriptNextStep(null,n)},3e3))})},locale:function(e){try{if("undefined"!=typeof t.locale)try{e.find('input[data-form-field="phone"]')[0].nextSibling.nodeValue=" "+t.locale.by_phone,e.find('input[data-form-field="email"]')[0].nextSibling.nodeValue=" "+t.locale.by_email,e.find(".leadia_widget_button_in_chat").text(t.locale.btns.next)}catch(e){}}catch(e){}return e}}},lc.BladeAppearance.mixins.formFieldController=function(e){return function(t,i){return{p:function(e){return $.proxy(e,this)},fillData:function(e,i){var n=t.storage.getJSON("_scenario"),a={};n&&n.step2&&n.step2.fields&&(a=n.step2.fields);for(var o in e.fields)e.fields[o].visible&&(i.find(("time_to_call"==o?"select":"input")+"[data-form-field="+o+"]").parent().show(),"time_to_call"==o?(i.find("select[data-form-field="+o+"] option:first").remove(),i.find("select[data-form-field="+o+"]").find('option[value="'+e.fields[o].value+'"]').attr("selected","selected")):e.fields[o].value?(i.find("input[data-form-field="+o+"]").val(e.fields[o].value),i.find("input[data-form-field="+o+"]").attr("value",e.fields[o].value)):i.find("input[data-form-field="+o+"]").attr("value",e.fields[o].value),a[o]&&!a[o].checked&&i.find("input[data-form-field="+o+"]").parent().attr("style","display: none !important"),["phone","email"].indexOf(o)===-1&&(e.fields[o].required?i.find("input[data-form-field="+o+"]").attr("data-necessary","true"):i.find("input[data-form-field="+o+"]").removeAttr("data-necessary")))},mergeData:function(e,i){var n,a=t.storage.getJSON("_scenario");return a&&a[e]&&a[e].data&&(n=a[e].data,i.fields.first_last_name.value=n.first_last_name||"",i.fields.email.value=n.email||"",i.fields.phone.value=n.phone||"",i.fields.region.value=n.region||""),i},init:function(e){i.utils.setupMessagesListener(t.p(t.messageListener));var n,a,o=$.extend(!0,{},t.form_field_json),s=$(t.formFieldHtml),r=t.storage.getJSON("_scenario");o=i.components.utils.deepExtend({},this.mergeData("socialAuth",o),this.mergeData("step3",o)),e="object"!=typeof e?o:i.utils.jsonMergeRecursive(o,e),n="number"==typeof e.writing?e.writing:5,a="undefined"!=typeof e.fromLocalstorage&&e.fromLocalstorage,this.fillData(e,s),"undefined"!=typeof t.contactform_text&&t.contactform_text.length>0&&s.find(".leadia-widget-message-text").text(t.contactform_text),s.find("#city_selector_iframe").length>0&&(window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),s.find("#city_selector_iframe").attr("src","//s3-eu-west-1.amazonaws.com/static.venyoo.ru/autocomplete/city_autocomplete.html?po="+encodeURIComponent(window.location.origin)));try{if(t.settings&&t.settings.social_auth){var l=t.locale.login_with?t.locale.login_with:"Войдите через",d={active_step:"step_one",fields:["all"],social_params:i.serverEnv.params.social_params};r&&r.socialAuth&&r.socialAuth.active_step?(d.active_step=r.socialAuth.active_step,d.data=r.socialAuth.data,d.data.title=d.data.title.substring(0,d.data.title.indexOf(","))):r&&r.step3&&r.step3.active_step&&(d.active_step=r.step3.active_step,d.data=r.step3.data);var c='